#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int line[110];
int row[110];
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int numl = 0;
		int numr = 0;
		memset(line,0,sizeof(line));
		memset(row,0,sizeof(row));
		for(int i = 0;i<n;i++)
		{
			int x,y;
			scanf("%d %d",&x,&y);
			if(!row[x]) 
			{
				numr++;
				row[x] = 1;
			}
			if(!line[y])
			{
				numl++;
				line[y] = 1;
			}
		}
		printf("%d\n",min(numr,numl));
	}
}
